import getAxios from "@/utils/dict-cache.js"; // 接口缓存

/**
 * 所有业务字典
 */
const dictRequest = (type, refresh = false) =>
  getAxios(`/admin/dict/type/${type}`, {
    cache: true, // 是否开启缓存
    repeat: true, // 是否开启防止同时发起多个相同请求
    refresh: refresh, // 是否刷新
  });

export default dictRequest;

export const dictGender = (refresh) => dictRequest("dict-gender", refresh); // 性别

export const dictGenderLimt = (refresh) => dictRequest("gender-limt", refresh); // 性别限制

export const dictTubeColor = (refresh) =>
  dictRequest("dict-tube-color", refresh); // 试管颜色

export const dictTubeType = (refresh) => dictRequest("dict-tube-type", refresh); // 试管类别

export const dictDeptType = (refresh) => dictRequest("dept-type", refresh); // 科室类型

export const dictDeptRegion = (refresh) => dictRequest("dept-region", refresh); // 科室区域

export const marriageLimit = (refresh) =>
  dictRequest("marriage-limit", refresh); //婚姻限制

export const dictSpecimenType = (refresh) =>
  dictRequest("specimen-type", refresh); // 标本类型

export const dictResultsType = (refresh) =>
  dictRequest("results-type", refresh); // 结果类型

export const dictProjectType = (refresh) =>
  dictRequest("project-type", refresh); // 项目类型

export const symbolType = (refresh) => dictRequest("symbol-type", refresh); //运算符类型

export const crisisVal = (refresh) => dictRequest("crisis-val", refresh); //危机值
